"""
枚举定义
=======
定义系统中使用的所有枚举类型
"""

from enum import Enum


class UserStatus(str, Enum):
    """用户状态"""
    PENDING = "pending"          # 待激活
    ACTIVE = "active"            # 活跃
    INACTIVE = "inactive"        # 不活跃
    SUSPENDED = "suspended"      # 暂停
    BANNED = "banned"           # 封禁
    DELETED = "deleted"         # 已删除


class UserRole(str, Enum):
    """用户角色"""
    ADMIN = "admin"             # 管理员
    TRADER = "trader"           # 交易员
    VIEWER = "viewer"           # 观察员
    VIP = "vip"                 # VIP用户
    GUEST = "guest"             # 访客


class TradeType(str, Enum):
    """交易类型"""
    BUY = "buy"                 # 买入
    SELL = "sell"               # 卖出


class OrderType(str, Enum):
    """订单类型"""
    MARKET = "market"           # 市价单
    LIMIT = "limit"             # 限价单
    STOP = "stop"               # 止损单
    STOP_LIMIT = "stop_limit"   # 止损限价单


class OrderStatus(str, Enum):
    """订单状态"""
    PENDING = "pending"         # 待处理
    OPEN = "open"               # 开放
    PARTIAL = "partial"         # 部分成交
    FILLED = "filled"           # 完全成交
    CANCELLED = "cancelled"     # 已取消
    REJECTED = "rejected"       # 已拒绝
    EXPIRED = "expired"         # 已过期


class MarketType(str, Enum):
    """市场类型"""
    STOCK = "stock"             # 股票
    FOREX = "forex"             # 外汇
    CRYPTO = "crypto"           # 加密货币
    COMMODITY = "commodity"     # 商品
    FUTURES = "futures"         # 期货
    OPTIONS = "options"         # 期权


class TimeFrame(str, Enum):
    """时间周期"""
    M1 = "1m"                   # 1分钟
    M5 = "5m"                   # 5分钟
    M15 = "15m"                 # 15分钟
    M30 = "30m"                 # 30分钟
    H1 = "1h"                   # 1小时
    H4 = "4h"                   # 4小时
    D1 = "1d"                   # 1天
    W1 = "1w"                   # 1周
    MN1 = "1M"                  # 1月


class NotificationType(str, Enum):
    """通知类型"""
    EMAIL = "email"             # 邮件
    SMS = "sms"                 # 短信
    PUSH = "push"               # 推送
    WEBHOOK = "webhook"         # Webhook


class NotificationStatus(str, Enum):
    """通知状态"""
    PENDING = "pending"         # 待发送
    SENT = "sent"               # 已发送
    DELIVERED = "delivered"     # 已送达
    FAILED = "failed"           # 发送失败
    READ = "read"               # 已读
